package com.nami.ucenter.client.response;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 描述：
 *
 * @Author: lbc
 * @Date: 2023-07-24 13:30
 * @email: 594599620@qq.com
 * @Description: keep coding
 */
@Data
public class UserDTO implements Serializable {

    private static final long serialVersionUID = 1896079217381341505L;

    private String userId;

    private String account;

    private String nickname;

    private String avatarUrl;

    /**
     * 用户状态
     */
    private Integer status;

    private String appKey;

    private String mobile;

    private String email;

    private Integer gender;

    private String motto;

    private String lastLoginIp;

    private Date lastLoginTime;

    public UserDTO() {
    }

    /**
     * deep clone constructor
     *
     * @param other the User object to be cloned
     */
    public UserDTO(UserDTO other) {
        this.userId = other.getUserId();
        this.account = other.getAccount();
        this.nickname = other.getNickname();
        this.avatarUrl = other.getAvatarUrl();
        this.status = other.getStatus();
        this.appKey = other.getAppKey();
        this.mobile = other.getMobile();
        this.email = other.getEmail();
        this.gender = other.getGender();
        this.motto = other.getMotto();
        this.lastLoginIp = other.getLastLoginIp();
        if (other.getLastLoginTime() != null) {
            this.lastLoginTime = new Date(other.getLastLoginTime().getTime());
        }

    }

    /**
     * deep clone method
     *
     * @return a new User object that is a deep copy of this object
     */
    public UserDTO clone() {
        return new UserDTO(this);
    }


}
